title: "Multivariable MR Tutorial" author: "Wes Spiller, Eleanor Sanderson, and Jack Bowden" date: "2 April 2020" output: html_vignette vignette: > %\VignetteIndexEntry{Multivariable MR Tutorial} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8}


knitr::opts_chunk$set(echo = TRUE)
library(devtools)
install_github("WSpiller/MVMR")
library(MVMR)

Overview

Multivariable Mendelian Randomisation (MVMR) is a form of instrumental variable analysis which estimates the direct effect of multiple exposures on an outcome using genetic variants as instruments. The MVMR R package facilitates estimation of causal effects using MVMR, as well as including a range of sensitivity analyses evaluating the underlying assumptions of the approach. The methods included in MVMR originate from Sanderson et al (2020), available at: [doi:]

Workflow

Fitting and interpreting MVMR models can be achieved by following the 5 steps given below:

  1. Obtain data
  2. Format data
  3. Assess instrument strength
  4. Assess horizontal pleiotropy
  5. Estimate causal effects

Each of these steps are shown in Figure 1, highlighting the R function used for each step.

Step 1: Obtain summary data

The following information is necessary to estimate causal effects using MVMR:

1) Gene-exposure associations for each variant selected as an instrument for any exposure.

2) Corresponding standard errors for the gene-exposure associations.

3) Gene-outcome associations for each instrument.

4) Corresponding standard errors for the gene-outcome associations.

The data frame rawdat_mvmr, included in the MVMR package shows an example of such data obtained from MRBase. In this case, low-density lipoprotein cholesterol (LDL-C), high-density lipoprotein cholesterol (HDL-C), and triglycerides (Trg) have been selected as exposures, while systolic blood pressure (SBP) is the outcome of interest. Here the suffix _beta is used to denote association estimates, while _se denotes standard errors. Please note that the MVMR can take an arbirtary number of exposures (greater than 1), and that three exposures have been selected purely for illustration.

The first 6 rows of rawdat_mvmr are:

head(rawdat_mvmr)

Note that the final column SNP contains the rsid numbers for each genetic variant. These are not necessary for conducting MVMR, but assist in follow-up analyses. Summary data for LDL-C, HDL-C, and Triglycerides originate from GLGC, while SBP data was obtained using UK Biobank.

Estimating pairwise covariances between SNP associations

The MVMR approach requires pairwise covariances between an instrument and pairs of exposures to be known across all SNPs for accurate estimation and sensitivity analyses, however, this is often not reported in published GWAS analyses. Before continuing with MVMR it is therefore necessary to select one of the following three solutions:

  1. Estimate the covariance terms using individual level data

If individual level data is available from which the GWAS summary estimates were obtained, the snpcov_mvmr() function can be used to calculate the necessary covariance terms.

  1. Estimate the phenotypic correlation between exposures from individual level data

If individual level data is available including phenotypic data, the phenocov_mvmr() function can be used to provide an approximation for the necessary covariance terms.

  1. Obtain gene-exposure associations from non-overlapping samples.

If gene-exposure associations are estimated in seperate non-overlapping samples, then the covariances will be zero by design. It is therefore not necessary to calculate the set of covariances, although this approach can be difficult to apply due to a lack of suitable sources of data.

Step 2: Format summary data

Downstream functions in the MVMR package rely upon prior formatting of raw summary data using the format_mvmr() function. Specifically, format_mvmr() checks and organises summary data columns for use in MVMR analyses. The format_mvmr function takes the following arguments:

BXGs

A subset containing beta-coefficient values for genetic associations with each exposure. Columns should indicate exposure number, with rows representing estimates for a given genetic variant.

BYG

A numeric vector of beta-coefficient values for genetic associations with the outcome.

seBXGs

A subset containing standard errors corresponding to the subset of beta-coefficients BXGs.

seBYG

A numeric vector of standard errors corresponding to the beta-coefficients BYG.

RSID

A vector of names for genetic variants included in the analysis. If variant IDs are not provided (RSID="NULL"), a vector of ID numbers will be generated.

Using the previous data rawdat.mvmr, we can format the data using the following command:

F.data<-format_mvmr(BXGs=rawdat_mvmr[,c(1,2,3)],
                    BYG=rawdat_mvmr[,7],
                    seBXGs=rawdat_mvmr[,c(4,5,6)],
                    seBYG=rawdat_mvmr[,8],
                    RSID=rawdat_mvmr[,9])

head(F.data)

In the above code we have provided the numbered columns for each argument. For example, BXGs=rawdat.mvmr[,c(1,2,3)] indicates that columns 1, 2, and 3 are the association estimates for exposures 1, 2, and 3. It is important to note that standard error columns seBXGs should be input in the same order as BXGs to ensure the correct matching of association estimates with corresponding standard errors.

In subsequent steps, each exposure is numbered such that X1, X2, and X3 are the first, second, and third entries in the BXGs=rawdat.mvmr[,c(1,2,3)] argument.

Step 3: Test for weak instruments

In univariate two-sample summary MR, genetic variants selected as instruments are required to be strongly associated with their corresponding exposure. This is quantified by regressing the exposure upon each instrument, and evaluating conditional dependence using the F-statistic for the instrument. Conventionally, a F-statistic greater than 10 is used as a threshold for sufficient instrument strength, representing a 10% relative bias towards the null in the two-sample MR setting.

Multivariable MR relies upon an extension of this assumption, requiring instruments to be strongly associated with their corresponding exposure conditioning on the remaining included exposures. Conditional instrument strength is quantified by a modified F-statistic which has the same distribution as the univariate F-statistic. Consequently, the same conventional instrument strength threshold of 10 can be used.

Further details are available at [doi:]

The strength_mvmr() function is used to evaluate instrument strength in the MVMR setting. The function contains two arguments:

r_input

A formatted data frame created using the format_mvmr() function.

gencov

A variance-covariance matrix for the effect of the genetic variants on each exposure. This is obtained from either snpcov_mvmr(), phenocov_mvmr(), or set to zero when omitted.

Note: The strength_mvmr() function will output a warning if a variance-covariance matrix is not provided. Please see Step 1 for further information.

Continuing with the previous example, we can evaluate the conditional strength of the instruments for each exposure using the following command

sres<-strength_mvmr(r_input=F.data,gencov=0)

In this case the set of instruments is sufficiently strong for MVMR estimation using the conventional F-statistic threshold of 10. However, note that we have manually set mvmrcov to zero, which would likely not be appropriate given each SNP-exposure estimate eas obtained from the same sample.

Step 4: Test for horizontal pleiotropy

Horizontal pleiotropy can be evaluated using a modified form of Cochran's Q statistic with respect to differences in MVMR estimates across the set of instruments. In this case, observed heterogeneity is indicative of a violation of the exclusion restriction assumption in MR (validity), which can result in biased effect estimates.

Importantly, weak instruments can increase the false positive rate for pleiotropy detection, as heterogeneity in effect estimates due to weak instrument bias is conflated with heterogeneity as a result of pleiotropic bias. As a correction it is possible to estimate heterogeneity from pleiotropy through Q-statistic minimisation.

The function pleiotropy_mvmr() can be used to test for pleiotropy, requiring the same arguments as the strength_mvmr(); r_input and mvmrcov.

pres<-pleiotropy_mvmr(r_input=F.data,gencov=0)

Step 5: Estimate causal effects

Two MVMR estimation methods are provided in the MVMR package. The first method fits an inverse variance weighted (IVW) MVMR model, providing estimates of the direct effect of each exposure upon the outcome. This is performed using the ivw_mvmr() function as shown below:

res<-ivw_mvmr(r_input=F.data)

In this case, the effect estimates are interpreted as the direct effects of LDL-C (exposure 1), HDL-C (exposure 2), and Trg (exposure 3) on SBP. Estimates are not robust to weak instruments of pleiotropic bias, and therefore rely upon the underlying MVMR assumptions being satisfied.



WSpiller/MRPracticals documentation built on April 25, 2020, 10:52 a.m.